function selAll()
{
	for(i=0;i<document.form2.askid.length;i++)
	{
		if(!document.form2.askid[i].checked)
		{
			document.form2.askid[i].checked=true;
		}
	}
}
function noSelAll()
{
	for(i=0;i<document.form2.askid.length;i++)
	{
		if(document.form2.askid[i].checked)
		{
			document.form2.askid[i].checked=false;
		}
	}
}
//获得选中文件的文件名
function getCheckboxItem()
{
	var allSel="";
	if(document.form2.askid.value) return document.form2.askid.value;
	for(i=0;i<document.form2.askid.length;i++)
	{
		if(document.form2.askid[i].checked)
		{
			if(allSel=="")
				allSel=document.form2.askid[i].value;
			else
				allSel=allSel+"`"+document.form2.askid[i].value;
		}
	}
	return allSel;
}

//获得选中其中一个的id
function getOneItem()
{
	var allSel="";
	if(document.form2.askid.value) return document.form2.askid.value;
	for(i=0;i<document.form2.askid.length;i++)
	{
		if(document.form2.askid[i].checked)
		{
				allSel = document.form2.askid[i].value;
				break;
		}
	}
	return allSel;
}
function digestask(aid){
	var qstr=getCheckboxItem();
	if(aid==0) aid = getOneItem();
	location="?do=ask_admin&aid="+aid+"&action=digest&qstr="+qstr;
}
function goodask(aid){
	var qstr=getCheckboxItem();
	if(aid==0) aid = getOneItem();
	location="?do=ask_admin&aid="+aid+"&action=good&qstr="+qstr;
}
function dealask(aid){
	var qstr=getCheckboxItem();
	if(aid==0) aid = getOneItem();
	location="?do=ask_admin&aid="+aid+"&action=deal&qstr="+qstr;
}
function holdask(aid){
	var qstr=getCheckboxItem();
	if(aid==0) aid = getOneItem();
	location="?do=ask_admin&aid="+aid+"&action=hold&qstr="+qstr;
}
function deleteask(aid){
	var qstr=getCheckboxItem();
	if(aid==0) aid = getOneItem();
	location="?do=ask_admin&qstr="+qstr+"&aid="+aid+"&action=delete";
}

//限制文本域 字体长度 maxlength设置
var TextUtil = new Object(); 
TextUtil.NotMax = function(oTextArea){ 
	var maxText = oTextArea.getAttribute("maxlength"); 
	if(oTextArea.value.length > maxText){ 
			oTextArea.value = oTextArea.value.substring(0,maxText); 
			alert("超出限制"); 
	} 
} 